package leecode

import (
	"fmt"
	"strconv"
)

func divisorSubstrings(num int, k int) (result int) {
	str := fmt.Sprintf("%v", num)
	windowsStr := str[:k] //初始化窗口
	for right := 1; right+k <= len(str); right++ {
		//字符串转整数
		temp, _ := strconv.Atoi(windowsStr)
		if temp != 0 && num%temp == 0 {
			result++
		}
		windowsStr = str[right : k+right]
	}
	return
}
